package com.android.jingweiapp.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by cuiwenrui-pc on 15/11/8.
 */
public class OrganizationBean implements Parcelable {

    public static final Parcelable.Creator<OrganizationBean> CREATOR = new Parcelable.Creator<OrganizationBean>() {
        public OrganizationBean createFromParcel(Parcel source) {
            return new OrganizationBean(source);
        }

        public OrganizationBean[] newArray(int size) {
            return new OrganizationBean[size];
        }
    };
    /**
     * id : 15
     * name : 办公室
     */

    private List<DataEntity> data;

    public OrganizationBean() {
    }

    protected OrganizationBean(Parcel in) {
        this.data = new ArrayList<DataEntity>();
        in.readList(this.data, List.class.getClassLoader());
    }

    public List<DataEntity> getData() {
        return data;
    }

    public void setData(List<DataEntity> data) {
        this.data = data;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeList(this.data);
    }

    public static class DataEntity implements Parcelable {
        public static final Creator<DataEntity> CREATOR = new Creator<DataEntity>() {
            public DataEntity createFromParcel(Parcel source) {
                return new DataEntity(source);
            }

            public DataEntity[] newArray(int size) {
                return new DataEntity[size];
            }
        };
        private String id;
        private String name;

        public DataEntity() {
        }

        protected DataEntity(Parcel in) {
            this.id = in.readString();
            this.name = in.readString();
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.name);
        }
    }
}
